package com.legendshop.openportal.sdk.model.request.v4;

import com.legendshop.openportal.sdk.model.BaseRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import java.io.Serializable;
import java.util.List;

import static com.legendshop.openportal.sdk.model.constants.ApiPathConstantsV4.COUPON_BATCH_IMPORT_V4;

/**
 * 批量发放优惠券dto
 *
 * @author ljk
 * @date 2025/6/30
 */
@Data
@ApiModel(value = "优惠券批量发放")
public class CouponBatchImportV4Request extends BaseRequest {

    @NotNull
    @ApiModelProperty("店铺ID")
    private Long shopId;

    @Valid
    @ApiModelProperty("批量发放信息")
    private List<ImportUserCoupon> importUserCoupons;

    @Override
    public String getApiPath() {
        return COUPON_BATCH_IMPORT_V4;
    }

    @Data
    @Builder
    @ApiModel(value = "发放优惠券信息")
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ImportUserCoupon implements Serializable {

        @ApiModelProperty("手机号")
        @NotBlank(message = "手机号不能为空")
        private String userMobile;

        @NotNull
        @ApiModelProperty("优惠券ID")
        private Long couponId;

        @NotNull
        @ApiModelProperty("优惠券数量")
        private Integer number;

    }
}
